function Y = updateSparse(Y,b,indx)
% This is mex-file that updates the values of a sparse matrix Y.
%   The mex-file should be called as:
%
%   updateSparse(Y,b)
%
%   which will implicitly do the following:  Y(omega) = b
%   where "omega" is the set of nonzero indices of Y (in linear
%   ordering, i.e. column-major ordering).
%
%   If "omega" is not sorted, then you must do the following:
%
%       [temp,indx] = sort(omega);  % we don't care about "temp"
%       updateSparse(Y,b,indx);
%
%   which will ensure that everything is in the proper order.

% This file and mex file by Stephen Becker, srbecker@caltech.edu 11.12.08

disp('If you see this message, then the mex file has not been compiled');
disp('To compile, type');
disp('      mex updateSparse.c');
disp('If this fails, then I would suggest changing this function call');
disp('to just the following line of code:');
disp('      Y(omega) = b;');